<style>
    #layui-upload-box li{
        width: 120px;
        height: 100px;
        float: left;
        position: relative;
        overflow: hidden;
        margin-right: 10px;
        border:1px solid #ddd;
    }
    #layui-upload-box li img{
        width: 100%;
    }
    #layui-upload-box li p{
        width: 100%;
        height: 22px;
        font-size: 12px;
        position: absolute;
        left: 0;
        bottom: 0;
        line-height: 22px;
        text-align: center;
        color: #fff;
        background-color: #333;
        opacity: 0.6;
    }
    #layui-upload-box li i{
        display: block;
        width: 20px;
        height:20px;
        position: absolute;
        text-align: center;
        top: 2px;
        right:2px;
        z-index:999;
        cursor: pointer;
    }
    #clearName{
        display: none;
    }
</style>
<script>
    layui.use(['element','form'],function () {
        var element = layui.element;
        var form = layui.form;

        form.on('select(myselect)', function(data){
            console.log(data.value)
            var areaId=(data.value);
            getAreaData(areaId,'#region')
        });
        function getAreaData(areaId,idattr) {
            $.ajax({
                type: 'POST',
                url: '{{ route('admin.region.getCity') }}',
                data: {province_id:areaId},
                dataType:  'json',
                success: function(data){
                    $(idattr).html("<option value='0'></option>");
                    if (data.status == 'T'){
                        $.each(data.data, function(key, val) {
                            var option1 = $("<option>").val(val.id+','+val.name).text(val.name);
                            $(idattr).append(option1);
                            form.render('select');
                        });
                    }

                }
            });
        }
    })


</script>
